test: run the blog e2e against a Bun-served blog (#523)#525
Conversation
The e2e harness must run under node --test (its node:test hook lifecycle does not survive bun test), but the blog server it spawns can run on Bun. Add a WEBJS_E2E_RUNTIME=bun override (WEBJS_BUN_PATH for the binary) so the full browser e2e exercises a Bun-served blog, proving the Bun.serve shell and Prisma-on-Bun end to end. Closes #523.
SSR action seeding (#472/#488) rides module.registerHooks, which Bun lacks, so on Bun it is disabled fail-open (the component re-fetches over RPC, data still correct). Gate the three seeded-vs-RPC assertions on WEBJS_E2E_RUNTIME so they skip on Bun, matching the Bun unit-test matrix's seed-hook carve-out.
The blog e2e under Bun surfaced a real framework bug (#528): an async-render component reading a signal goes inert after its on-hydration re-fetch (seeding off), so a signal bump never supersedes a fetch to abort. Reproduced on Node with WEBJS_SEED=0, so it is a framework bug to fix, not a Bun carve-out. Skip the abort test on Bun referencing #528 so the rest of the cross-runtime e2e is green; remove the skip when #528 lands.
vivek7405
left a comment
There was a problem hiding this comment.
Ran the full suite against a Bun-served blog and it comes back 83 pass, 4 skipped, 0 fail. The override is scoped to just the blog spawn (node default untouched), and the four skips are exactly the runtime-fragile ones: the three seeding assertions (node-only since Bun has no module.registerHooks) and the abort test, which is where this got interesting. The abort failure on Bun is not a Bun gap, it is a real reactivity bug: an async render that reads a signal goes inert after its on-hydration re-fetch, and it reproduces on node with WEBJS_SEED=0. Filed that as #528 and gated the one test against it rather than papering over it. The other async-render tests stay un-gated because they do not take the on-hydration re-fetch path. Worth running the suite under Bun in CI the way this does, it is how #528 surfaced at all.
vivek7405
left a comment
There was a problem hiding this comment.
Checked the one thing I had not executed: running the suite twice against the same seeded DB. It is safe. The only DB write in the e2e is the signup, which mints a unique email per run, the feedback action does not touch Prisma, and nothing asserts an exact row count or a fixed seeded row. The Bun start is fine too, the ready log fires when the socket binds, before the jspm vendor resolve, so the 15s ready window never waits on a cold resolve. Good to merge.
Closes #523
Add a cross-runtime e2e: the harness stays on
node --test(its node:test hook lifecycle breaks underbun test), butstartBlognow spawns the blog server under Bun whenWEBJS_E2E_RUNTIME=bunis set. This runs the full Puppeteer suite against a Bun-served blog, proving theBun.serveshell and Prisma-on-Bun in a real browser, and runs as a second e2e step in CI.Result
Full e2e under Bun: 83 pass, 0 fail, 4 skipped. The 4 skips are documented and runtime-correct:
module.registerHooks, unavailable on Bun, so it is disabled fail-open (data still correct, the seeded-vs-RPC assertion is node-only). Same carve-out the Bun unit matrix makes.It found a real bug (#528)
The Bun run surfaced a genuine framework bug, not a runtime gap: an
async render()component that reads a signal goes inert after its on-hydration re-fetch (which only happens when seeding is off, always on Bun). Reproduced on Node withWEBJS_SEED=0, so it is a framework bug to FIX (filed as #528), not a Bun carve-out. Seeding masks it by default on Node. The abort test is skipped on Bun referencing #528; the skip is removed when #528 lands.Surfaces
test/e2e/e2e.test.mjs: theWEBJS_E2E_RUNTIME=bunruntime override + the gated tests..github/workflows/ci.yml: a second e2e run with the blog on Bun (the e2e job already has chromium + the seeded DB).